<%--
  Created by IntelliJ IDEA.
  User: Yy
  Date: 2022/5/24
  Time: 9:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/ajaxForm.js"></script>
    <script>
        layui.use(['form', 'laydate', 'layer'], function () {
            var form = layui.form, laydate = layui.laydate, layer = layui.layer;
            //监听表单提交
            form.on('submit(formbtn)', function () {
                $("#formsbt").ajaxSubmit({
                    type: "post",
                    url: '${pageContext.request.contextPath}/stu/addweek',
                    success: function (data) {//添加成功的回调函数
                        var index = parent.layer.getFrameIndex(window.name);//获取Frame索引
                        parent.layer.close(index);//关闭当前frame
                        parent.layui.table.reload("titleStu");//可以对父窗口进行刷新
                    }
                });
            });
        });
    </script>
</head>
<body>
    <form class="layui-form" id="formsbt">
        <%--    课程名称--%>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-inline">
                <select name="orderId">
                    <option value="1">上</option>
                    <option value="2">中</option>
                    <option value="3">下</option>
                </select>
            </div>
            <div class="layui-form-mid layui-word-aux">必填项</div>
        </div>
        <%--    课程名称--%>
        <div class="layui-form-item">
            <label class="layui-form-label">排班名称</label>
            <div class="layui-input-inline">
                <input type="text" name="weekArrangeName" id="weekArrangeName" placeholder="排班名称"
                       autocomplete="off" class="layui-input" lay-verify="required">
            </div>
            <div class="layui-form-mid layui-word-aux">必填项</div>
        </div>
        <%--    课程名称--%>
        <div class="layui-form-item">
            <label class="layui-form-label">值班要求</label>
            <div class="layui-input-inline">
                <input type="text" name="ranges" id="ranges" placeholder="值班要求"
                       autocomplete="off" class="layui-input" lay-verify="required">
            </div>
            <div class="layui-form-mid layui-word-aux">必填项</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">时间</label>
            <div class="layui-input-inline">
                <select name="week">
                    <option value="星期一">星期一</option>
                    <option value="星期二">星期二</option>
                    <option value="星期三">星期三</option>
                    <option value="星期四">星期四</option>
                    <option value="星期五">星期五</option>
                    <option value="星期六">星期六</option>
                    <option value="星期天">星期天</option>
                </select>
            </div>
        </div>

<%--            查询员工表--%>
        <div class="layui-form-item">
            <label class="layui-form-label">值班人员</label>
            <div class="layui-input-inline">
                <select name="empId">
                    <c:forEach items="${elist}" var="e">
                        <option value="${e.empId}">${e.empName}</option>
                    </c:forEach>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">总值班</label>
            <div class="layui-input-inline">
                <select name="duty">
                    <option value="1">是</option>
                    <option value="2">否</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">开始时间</label>
            <div class="layui-input-inline">
                <select name="startTime">
                    <option value="19:00">19:00</option>
                    <option value="19:30">19:30</option>
                    <option value="20:00">20:00</option>
                    <option value="20:30">20:30</option>
                    <option value="21:00">21:00</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">结束时间</label>
            <div class="layui-input-inline">
                <select name="endTime">
                    <option value="19:00">19:00</option>
                    <option value="19:30">19:30</option>
                    <option value="20:00">20:00</option>
                    <option value="20:30">20:30</option>
                    <option value="21:00">21:00</option>
                </select>
            </div>
        </div>
        <%--    备注--%>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-inline">
                <input type="text" name="remark" id="remark" placeholder="备注"
                       autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <button id="formbtn" type="button" lay-submit lay-filter="formbtn" class="layui-btn layui-btn-normal">
                保存
            </button>
            <button id="reset" type="reset" class="layui-btn layui-btn-normal">
                重置
            </button>
        </div>
    </form>
</body>
</html>
